import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

class Test05 extends StatefulWidget {
  @override
  _Test05State createState() => _Test05State();
}

class _Test05State extends State<Test05> {
  var groupValue;

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Row(
        children: [
          Radio(
              value: "语文",
              activeColor: Colors.red,
              groupValue: groupValue,
              onChanged: (value) {
                setState(() {
                  groupValue = value;
                });
              }),
          Radio(
              value: "数学",
              groupValue: groupValue,
              onChanged: (value) {
                setState(() {
                  groupValue = value;
                });
              }),
          Radio(
              value: "英语",
              groupValue: groupValue,
              onChanged: (value) {
                setState(() {
                  groupValue = value;
                });
              }),
        ],
      ),
    );
  }
}
